package com.eunion.boot.security;

import javax.servlet.http.HttpServletRequest;

import org.springframework.security.authentication.AuthenticationDetailsSource;
import org.springframework.security.web.authentication.WebAuthenticationDetails;
import org.springframework.stereotype.Component;

/**
 * 自定义的AuthenticationDetailsSource
 * 该接口用于在Spring Security登录过程中对用户的登录信息的详细信息进行填充，默认实现是WebAuthenticationDetailsSource，生成上面的默认实现WebAuthenticationDetails。
 * 
 * @since 2017年2月5日
 */
@Component
public class SysAuthenticationDetailsSource implements AuthenticationDetailsSource<HttpServletRequest, WebAuthenticationDetails> {

	@Override
	public WebAuthenticationDetails buildDetails(HttpServletRequest context) {
		return new SysWebAuthenticationDetails(context);
	}
}
